package com.heitian.ssm.service.impl;

import com.heitian.ssm.dao.CallRecordDao;
import com.heitian.ssm.dao.RecentContactsDao;
import com.heitian.ssm.model.CallRecord;
import com.heitian.ssm.model.RecentContacts;
import com.heitian.ssm.service.RecentContactsService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class RecentContactsServiceImpl implements RecentContactsService{

    @Resource
    private RecentContactsDao recentContactsDao;

    public Integer save(RecentContacts recentContacts) {
        return recentContactsDao.saveRecentContacts(recentContacts);
    }

    public Integer update(RecentContacts recentContacts) {
        return recentContactsDao.updateRecentContacts(recentContacts);
    }

    public Integer delete(String id) {
        return recentContactsDao.deleteRecentContacts(id);
    }

    public List<RecentContacts> select(String place) {
        return recentContactsDao.selectRecentContactsByPlace(place);
    }

    public RecentContacts selectById(String id,String place){ return recentContactsDao.selectRecentContactsById(id,place); }
}
